{% load i18n %}
{% load pybb_tags %}
<div class="separator"></div>
<div class="post-details post-{% cycle 'odd' 'even' %}" id="post-{{ post.id }}">
  <a name="post-{{ post.id }}"></a>
  <div class="info">
    <div class="inner">
      <div class="avatar-info">
        <div class="avatar">
          <a href="{{ post.user.pybb_profile.get_absolute_url }}">
            <img src="{{ post.user|pybb_avatar_url }}" alt="" />
          </a>
        </div>
      </div>
      <div class="text-info">
        <div class="author">{{ post.user|pybb_profile_link }}</div>
        {% if user.is_superuser %}
        <div class="updated">{{ post.user_ip }}</div>
        {% endif %}
        
        {% if post.user.pybb_profile.ban_status %}
        <div{% if post.user.pybb_profile.is_banned %}
               title="{% trans 'Expire' %} {{ post.user.pybb_profile.ban_till }}"{% endif %}
               class="banned">
          {{ post.user.pybb_profile.get_ban_status_display }}
        </div>
        {% endif %}
      </div>
      <div class="clear"></div>
    </div>
  </div>
  <div class="content">
    <div class="inner">
      <div class="inner-left">
        <!-- Post's content -->
        <div class="post-body">
          {% pybb_render_post post %}
        </div>
  
        <!-- Attachments -->
        {% if post.attachment_cache %}
        {% for attach in post.attachment_cache %}
        <br/>
        {% trans "Attachment" %}: <a href="{{ attach.get_absolute_url }}">{{ attach.name }}</a> ({{ attach.size_display }})
        {% endfor %}
        {% endif %}
  
        <!-- Signature -->
        {% if not user.is_authenticated or user.pybb_profile.show_signatures %}
        {% if post.user.pybb_profile.signature %}
        <div class="signature">
          <hr/>
          {{ post.user.pybb_profile.signature_html|safe }}
        </div>
        {% endif %}
        {% endif %}
  
      </div>
      <div class="inner-right">
        <div class="update-info">
          <a class="permalink" href="{{ post.get_absolute_url }}">#</a>
          <span class="updated">{% pybb_time post.created %}</span>
        </div>
      </div>
      <div class="clear"></div>
      <!-- Last modification date -->
      {% if post.updated %}
      <div class="update-date">
        {% trans "Edited" %} by the author {% pybb_time post.updated %}
      </div>
      {% endif %}
      <div class="post-related">
        <div class="post-controls">
          <div class="post-new">
            <div class="post-new-left"></div>
            <div class="post-new-btn"><a href="{% url pybb_post_add topic.id %}?quote_id={{ post.id }}">{% trans "Quote" %}</a></div>
            <div class="post-new-right"></div>
          </div>
          {% if moderator or post|pybb_posted_by:user %}
          <div class="post-new">
            <div class="post-new-left"></div>
            <div class="post-new-btn"><a href="{% url pybb_post_edit post.id %}">{% trans "Edit" %}</a></div>
            <div class="post-new-right"></div>
          </div>
          {% endif %}
          {% if moderator or post|pybb_equal_to:last_post %}
          {% if moderator or post.user|pybb_equal_to:user %}
          <div class="post-new">
            <div class="post-new-left"></div>
            <div class="post-new-btn">
              <a onclick="pybb_delete_post('{% url pybb_post_delete post.id %}',
                 'post-{{ post.id }}', '{% trans 'Delete post?' %}'); return false;"
                 href="{% url pybb_post_delete post.id %}">{% trans "Delete" %}</a>
            </div>
            <div class="post-new-right"></div>
          </div>
          {% endif %}
          {% endif %}
        </div>
      </div>
    </div>
  </div>
  <div class="clear"></div>
</div>
